package day7zy;

import java.util.ArrayList;
import java.util.Scanner;

public class Gs {
    String mc;
    String dz;
    String dh;
    String fw;
    ArrayList<String> ygs = new ArrayList<>();
    public void add(String name) {
            ygs.add(name);
        }
    public void show(){
        System.out.println(ygs);
    }
    public void remove(int index){
        ygs.remove(index);
    }
}
class gss extends Gs {
    public static void main(String[] args) {
        System.out.println("开业大吉");
        Scanner in = new Scanner(System.in);
        gss kh = new gss();
        System.out.print("请输入公司名称：");
        kh.mc = in.next();
        System.out.print("请输入注册地址：");
        kh.dz = in.next();
        System.out.print("请输入电话：");
        kh.dh = in.next();
        System.out.print("请输入经营范围：");
        kh.fw = in.next();
        int choice = 0;
        while (true) {
            System.out.println("1:招聘员工\n2:查看员工信息\n3:辞退员工\n4:退出");
            choice = in.nextInt();
            switch (choice) {
                case 1: {
                    System.out.print("员工姓名：");
                    String ygname = in.next();
                    kh.add(ygname);
                }
                break;
                case 2: {
                    kh.show();
                }
                break;
                case 3: {
                    System.out.print("输入辞退员工位置：");
                    int index = in.nextInt();
                    kh.remove(index);
                }
                break;

            }
        }
    }
}